<?require_once("connection.php");
error_reporting(0);
  $oper = $_POST["oper"];
  $rec = $_POST["rec"];

  $course_id = $_POST["course_id"];
  $seq_num = $_POST["seq_num"];
  $date = $_POST["date"];
  $description = $_POST["description"];
  //$slide = $_POST["slide"];
  $slide = "none";
  $slide_url = "none";
  //$additional = $_POST["additional"];
  $additional = "none";
  $additional_url = "none";
  
  //$ok = copy("C:/Users/Maxat/Downloads/".$slide,"C:/Users/Maxat/Desktop/".$slide);
  //echo $ok;
  //echo $_FILES["upload_image"]["name"];

  //echo $date."<br>";
  //echo $visible."<br>";
  //echo $person_id."<br>";
//  echo $oper."asdfasdf";

  if($oper==0)
    $query = "insert into g_lectures values('none', ".$seq_num.", '".$date."', '".$description."', '".$slide."', '".$slide_url."', '".$additional."', '".$additional_url."', ".$course_id.");";
  else
    if($oper==1)
      $query = "update g_lectures set seq_num=".$seq_num.", date='".$date."', description='".$description."', course_id=".$course_id." where lecture_id=".$rec.";";
  $result = mysql_query($query, $connection);

  if(empty($result)){
    if($oper==0)
      echo "<pre>The record has not been ADDED!!!</pre>";
    else
      echo "<pre>The record has not been EDITED!!!</pre>";
  }
  else{
    if($oper==0)
      echo "<pre>The record has been successfully ADDED</pre>";
    else
      echo "<pre>The record has been successfully EDITED</pre>";
  }
  require_once("display_lectures.php");
?>
